; ..............................................................................
;    File   pasabajo.s
; ..............................................................................

		.equ pasabajoNumTaps, 53

; ..............................................................................
; Allocate and initialize filter taps

		.section .xdata
		.align 128

pasabajoTaps:
.hword 	0xFFAE,	0xFE88,	0xFF3E,	0x0106,	0x019C,	0x001A,	0xFE50,	0xFE99,	0x00CE
.hword 	0x0230,	0x00C8,	0xFE21,	0xFDA7,	0x0054,	0x0300,	0x01FD,	0xFDFE,	0xFBF3
.hword 	0xFF36,	0x048E,	0x04EA,	0xFDE8,	0xF6BB,	0xFA87,	0x0C96,	0x22B0,	0x2CA7
.hword 	0x22B0,	0x0C96,	0xFA87,	0xF6BB,	0xFDE8,	0x04EA,	0x048E,	0xFF36,	0xFBF3
.hword 	0xFDFE,	0x01FD,	0x0300,	0x0054,	0xFDA7,	0xFE21,	0x00C8,	0x0230,	0x00CE
.hword 	0xFE99,	0xFE50,	0x001A,	0x019C,	0x0106,	0xFF3E,	0xFE88,	0xFFAE

; ..............................................................................
; Allocate delay line in (uninitialized) Y data space

		.section .ybss,  "b"
		.align 128

pasabajoDelay:
		.space pasabajoNumTaps*2

; ..............................................................................
; Allocate and intialize filter structure

		.section .data
		.global _pasabajoFilter

_pasabajoFilter:
.hword pasabajoNumTaps
.hword pasabajoTaps
.hword pasabajoTaps+pasabajoNumTaps*2-1
.hword 0xff00
.hword pasabajoDelay
.hword pasabajoDelay+pasabajoNumTaps*2-1
.hword pasabajoDelay

; ..............................................................................
; ..............................................................................
; Sample assembly language calling program
;  The following declarations can be cut and pasted as needed into a program
;		.extern	_FIRFilterInit
;		.extern	_BlockFIRFilter
;		.extern	_pasabajoFilter
;
;		.section	.bss
;
;	 The input and output buffers can be made any desired size
;	   the value 40 is just an example - however, one must ensure
;	   that the output buffer is at least as long as the number of samples
;	   to be filtered (parameter 4)
;input:		.space	40
;output:	.space	40
;		.text
;
;
;  This code can be copied and pasted as needed into a program
;
;
; Set up pointers to access input samples, filter taps, delay line and
; output samples.
;		mov	#_pasabajoFilter, W0	; Initalize W0 to filter structure
;		call	_FIRFilterInit	; call this function once
;
; The next 4 instructions are required prior to each subroutine call
; to _BlockFIRFilter
;		mov	#_pasabajoFilter, W0	; Initalize W0 to filter structure
;		mov	#input, W1	; Initalize W1 to input buffer 
;		mov	#output, W2	; Initalize W2 to output buffer
;		mov	#20, W3	; Initialize W3 with number of required output samples
;		call	_BlockFIRFilter	; call as many times as needed
